import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/home"
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/index.vue')
  },
  {
    path: '/home/city',
    name: 'city',
    component: () => import('../views/home/city/index.vue')
  },
  {
    path: '/home/categorylist',
    name: 'categorylist',
    component: () => import('../views/home/categorylist/index.vue')
  },
  {
    path: '/home/brandlist',
    name: 'brandlist',
    component: () => import('../views/home/brandlist/index.vue')
  },
  {
    path: '/home/branddetail',
    name: 'branddetail',
    component: () => import('../views/home/branddetail/index.vue')
  },
  {
    path: '/home/isNew',
    name: 'isNew',
    component: () => import('../views/home/isNew/index.vue')
  },
  {
    path: '/home/detailaction',
    name: 'detailaction',
    component: () => import('../views/home/detailaction/index.vue')
  },
  {
    path: '/topic',
    name: 'topic',
    component: () => import('../views/topic/index.vue')
  },
  {
    path: '/topic/detailaction',
    name: 'topicDetailaction',
    component: () => import('../views/topic/detailaction/index.vue')
  },
  {
    path: '/category',
    name: 'category',
    component: () => import('../views/category/index.vue')
  },
  {
    path: '/category/categoryList',
    name: 'category',
    component: () => import('../views/category/categoryList/index.vue')
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('../views/cart/index.vue')
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('../views/mine/index.vue'),
  },
  {
    path: '/mine/address',
    name: 'address',
    component: () => import('../views/mine/address/index.vue'),
  },
  {
    path: '/mine/address/newAddress',
    name: 'newAddress',
    component: () => import('../views/mine/address/newAddress/index.vue'),
  },
  {
    path: '/mine/address/editAddress',
    name: 'editAddress',
    component: () => import('../views/mine/address/editAddress/index.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
